#include "KDTreeNode.h"

KDTreeNode::KDTreeNode(){
	triangles = vector<Triangle*>();
	planeNormal = Vector3(0,0,0);
	position = Point3(0,0,0);
	frontChild = NULL;
	backChild = NULL;
}

KDTreeNode::~KDTreeNode(){
	triangles.clear();
}

vector<Triangle*> KDTreeNode::getTriangles()
{
	return triangles;
}

void KDTreeNode::addTriangle( Triangle* t )
{
	triangles.push_back( t );
}

void KDTreeNode::setPosition(float x, float y, float z){
	position = Point3(x,y,z);
}

void KDTreeNode::setFrontChild( KDTreeNode* newNode )
{
	frontChild = newNode;
}
void KDTreeNode::setBackChild( KDTreeNode* newNode )
{
	backChild = newNode;
}

Point3 KDTreeNode::getPosition(){
	return position;
}

KDTreeNode* KDTreeNode::getFrontChild()
{
	return frontChild;
}
KDTreeNode* KDTreeNode::getBackChild()
{
	return backChild;
}